package org.example.demo21.decorator.coffee;

import org.example.demo21.decorator.Coffee;

import java.math.BigDecimal;

/**
 *
 * @author guocong
 * @since 2024/4/1 10:38
 */
public class Latte implements Coffee {


    private final Coffee decoratedCoffee;

    public Latte(Coffee decoratedCoffee) {
        this.decoratedCoffee = decoratedCoffee;
    }

    @Override
    public String desc() {
        return decoratedCoffee.desc() + " + 甜奶";
    }

    @Override
    public BigDecimal price() {
        return decoratedCoffee.price() .add(new BigDecimal("5")) ;
    }

}

